<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <h1>pageC</h1>
  <code id="code"></code>
  <button id="submit">jsonp获取A服务器数据</button>
  <script>
    function getData(data) {
      console.log(Object.prototype.toString.call(data));
      document.getElementById('code').innerText = JSON.stringify(data)
    }
    document.getElementById('submit').onclick = function () {
      var newscript = document.createElement('script')
      newscript.setAttribute('src', 'http://localhost:8000/jsonp?callback=getData')
      document.body.appendChild(newscript)
    }
  </script>
</body>

</html>